{
    let reg1=new RegExp('xxx','i');
    let reg2=/xxx/igm;

    console.log(reg2.flags);
}
{
    let reg=new RegExp(/xxx/igm,'i');
    console.log(reg.flags);
}
{
    let str='bbb_bb_b';
    let reg1=/b+/g;
    let reg2=/b+/y;
    console.log(reg1.exec(str),reg2.exec(str));
    console.log(reg1.exec(str),reg2.exec(str));
    console.log(reg1.sticky,reg2.sticky);
}
{
    console.log(/^\uD83D/u.test('\uD83D\uDC2A'));
    console.log(/^\uD83D/.test('\uD83D\uDC2A'));
    var s="𠮷";
    console.log(/^.$/.test(s));
}